package com.example.demo.consumer;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.amqp.rabbit.annotation.RabbitListener;
import org.springframework.stereotype.Component;

import java.util.Map;

/**
 * @author ghl
 * @version 1.0
 * @date 2022/9/19 13:18
 * @description 摘要
 */
@Component
public class RabbitConsumer {

    private static final Logger LOGGER = LoggerFactory.getLogger(RabbitConsumer.class);

    @RabbitListener(queues = "fanout.A")
    public void run1(Map map) {
        LOGGER.info("扇形交换机队列A,接收到消息[{}]", map.toString());
    }

    @RabbitListener(queues = "fanout.B")
    public void run2(Map map) {
        LOGGER.info("扇形交换机队列B,接收到消息[{}]", map.toString());
    }

    @RabbitListener(queues = "fanout.C")
    public void run3(Map map) {
        LOGGER.info("扇形交换机队列C,接收到消息[{}]", map.toString());
    }

}
